<?php
require_once 'lib/controllerWithoutGetOrPost.php';
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("content-type:application/xml;charset=utf-8;");

$query = "SELECT `FeaturingPerson`.Blurb, `FeaturingPerson`.PersonID, `FeaturingPerson`.Position, Person.DeathDate, Person.Surname, Person.FirstNames FROM `FeaturingPerson` left join `Person` on `FeaturingPerson`.PersonID = Person.ID Where `Position` Between 0 and 9 order by `Position` ASC";

// Perform Query
$result = $db->query($query);

if (!empty($result)) {
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>\n";
    while (TRUE) {
        $row = mysql_fetch_assoc($result);
        if (empty($row)) {
            break;
        }
        $position = $html->text($db->unescape($row['Position']));
        $surname = $html->text($db->unescape($row['Surname']));
        $firstNames = $html->text($db->unescape($row['FirstNames']));
        $personId = intval($row['PersonID']);
        echo "<item><value>".$position."</value>\n";
        echo "<name>".$surname." ".$firstNames."</name>\n";
        echo "<id>".$personId."</id>\n</item>\n";
    }
    echo "</items>";
}
?>